<?php

/**
 * Komentarze form base class.
 *
 * @method Komentarze getObject() Returns the current form's model object
 *
 * @package    testyZlecenia
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseKomentarzeForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'id'                      => new sfWidgetFormInputHidden(),
      'tresckomentarza'         => new sfWidgetFormTextarea(),
      'uzytkownicy_id'          => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Uzytkownicy'), 'add_empty' => false)),
      'datawystawienia'         => new sfWidgetFormDateTime(),
      'zgloszenia_id'           => new sfWidgetFormInputHidden(),
      'odrzucone_zgloszenia_id' => new sfWidgetFormInputHidden(),
      'raport_id'               => new sfWidgetFormInputHidden(),
    ));

    $this->setValidators(array(
      'id'                      => new sfValidatorChoice(array('choices' => array($this->getObject()->get('id')), 'empty_value' => $this->getObject()->get('id'), 'required' => false)),
      'tresckomentarza'         => new sfValidatorString(),
      'uzytkownicy_id'          => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Uzytkownicy'))),
      'datawystawienia'         => new sfValidatorDateTime(array('required' => false)),
      'zgloszenia_id'           => new sfValidatorChoice(array('choices' => array($this->getObject()->get('zgloszenia_id')), 'empty_value' => $this->getObject()->get('zgloszenia_id'), 'required' => false)),
      'odrzucone_zgloszenia_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('odrzucone_zgloszenia_id')), 'empty_value' => $this->getObject()->get('odrzucone_zgloszenia_id'), 'required' => false)),
      'raport_id'               => new sfValidatorChoice(array('choices' => array($this->getObject()->get('raport_id')), 'empty_value' => $this->getObject()->get('raport_id'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('komentarze[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'Komentarze';
  }

}
